package com.ph.website.home.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ph.website.home.entity.News;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface NewsMapper extends BaseMapper<News> {

    /**后台分页查询新闻列表*/
    List<News> list(@Param("start")Integer start,
                    @Param("num")Integer num,
                    @Param("title")String title,
                    @Param("newsState")Integer newsState,
                    @Param("newsType")Integer newsType);

    /**后台分页查询新闻列表总数*/
    int countList(@Param("title")String title,
                  @Param("newsState")Integer newsState,
                  @Param("newsType")Integer newsType);

    /**获取下一篇*/
    News next(@Param("orderNum")Long orderNum,
              @Param("newsType")Integer newsType);


    /**获取上一篇*/
    News last(@Param("orderNum")Long orderNum,
              @Param("newsType")Integer newsType);

}
